<script language="javascript">
function selectAll(len)
{
	var i=0;
	for(i=0;i<len;i++)
	{
		document.getElementById('check'+(i+1)).checked=true;
	}
}
function selectNone(len)
{
	var i=0;
	for(i=0;i<len;i++)
	{
		document.getElementById('check'+(i+1)).checked=false;
	}
}
</script>
<table width="616" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div class="Innerheading" id="Innerheading">Accept Registration
    </div></td>
  </tr>
  <tr>
    <td><div class="InnerDarkbox" id="InnerDarkbox"><?php
	require_once("../includes/user.php");
	$user=new User;
	$count=$user->recCount('user_profile',"accept=0");
	if($count>0)
	{
	?>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td>Select</td>
      <td align="left"><div class="clickLink" onclick="selectAll(<?php echo $count; ?>)">All</div></td>
      <td><div class="clickLink" onclick="selectNone(<?php echo $count; ?>)">None</div></td>
      <td align="right"><span class="smartlink" onclick="Selected(<?php echo $count; ?>,1)">Accept Selected</span></td>
      <td align="center"><span class="smartlink" onclick="Selected(<?php echo $count; ?>,2)">Reject Selected</span></td>
    </tr>
        
    <?php
		$i=1;
		$req_res=$user->getProfileRequest();
		while($req_row=mysql_fetch_array($req_res))
		{
			?>
    <tr>
      <td colspan="5">&nbsp;</td>
      </tr>
    <tr>
      <td colspan="2" align="right"> .
        <input type="checkbox" name="check<?php echo $i; ?>" id="check<?php echo $i; ?>" value="<?php echo $req_row['id']; ?>" /></td>
      <td><?php echo $i;  ?></td>
      <td align="left" valign="middle"><?php
	 	 echo $req_row['name'].", "; 
	  	if($req_row['desg']!='')
		{
			echo '<strong>'.$req_row['desg'].'</strong>';
		}
		if($req_row['year']!='')
		{
			echo $user->getYear($req_row['year']);
		}
	   ?></td>
      <td align="center"><input type="image" src="img/buttons/view.gif" onclick="viewProfile(<?php echo $req_row['id']; ?>)" /></td>
    </tr>
            <?php
			$i++;
		}
	?>
        <tr>
      <td colspan="5">&nbsp;</td>
      </tr>
      <?php
	  	if($count>10)
		{
	  ?>
     <tr>
      <td width="58">Select</td>
      <td width="30" align="center"><div class="clickLink" onclick="selectAll(<?php echo $count; ?>)">All</div></td>
      <td width="35"><div class="clickLink" onclick="selectNone(<?php echo $count; ?>)">None</div></td>
      <td width="338" align="right"><span class="smartlink" onclick="Selected(<?php echo $count; ?>,1)">Accept Selected</span></td>
      <td width="155" align="center"><span class="smartlink" onclick="Selected(<?php echo $count; ?>,2)">Reject Selected</span></td>
    </tr>
    <?php
		}
	?>
  </table>
  <?php
  	}
	else
	{
	?>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="middle">There is no more pending Requests</td>
  </tr>
</table>
<?php
	}
?>
</div></td>
  </tr>
</table>